#include "myfirst.h"
#include "square.h"
#include <QVector>
#include <QList>
#include <QDebug>
#include <QFile>
#include <QDir>
#include <QTextStream>
#include <QString>
#include <QList>
#include <cmath>




Square::Square(float first)//  по умолчанию координаты данной фигуры
{
    a = first;
    x1=0;
    x2=0;
    turn=0;
}
Square::Square(float first,float firstPosition,float secondPosition,float povorot)
{
    a=first;
    x1=firstPosition;
    x2=secondPosition;
    turn=povorot;
    if(turn<0)
    {
        while(turn < 0)
        {
            turn= turn + 360;
        }
    }
    else
    {
        while (turn > 360)
        {
            turn=turn - 360;
        }
    }
}
float Square::perimetr()
{
   return a*4;
}
float Square::ploshadb()
{
    return a*a;
}
QString Square::print_name()
{
    QString name="Square";
         return name;
}
QList<QString> Square::print_inf()
{
    return {QString::number(a),QString::number(x1),QString::number(x2),QString::number(turn)};
}

void Square::chengeKoordinat(float firstX, float secondX)
{
    x1=x1+firstX;
    x2=x2+secondX;
}

